java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

问题描述:

在使用JDBC连接数据库的时候,报错:

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

解决方案:

经检查,是由于连接的URL写错导致,原URL:"jdbc:oracle:thin:@localhost:1521:java78"

更改后:"jdbc:oracle:thin:@localhost:1521:ORCL"

posted @ 2018-08-12 11:42  Quest1on  阅读(12694)  评论(0编辑  收藏  举报